<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddColumnInShopToUserRoleMapping extends Migration
{
    /**
     * Run the migrations.
     * 添加员工到店
     * @return void
     */
    public function up()
    {
        Schema::table('user_role_mappings', function (Blueprint $table) {
            $table->unsignedTinyInteger('inShop')->default(0)->after('shopId')->comment('是否在店 0-在店  1-不在店');
            $table->unsignedInteger('entryTime')->default(0)->after('shopId')->comment('入职时间');
            $table->unsignedInteger('leaveTime')->default(0)->after('shopId')->comment('离职时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user_role_mappings', function (Blueprint $table) {
            $table->dropColumn('inShop');
            $table->dropColumn('entryTime');
            $table->dropColumn('leaveTime');
        });
    }
}
